package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by zhangjh on 2016/10/12.
 */
@Entity
@Table(name = "shopping_cart")
@DynamicInsert
@DynamicUpdate
public class ShoppingCart extends IDEntityMall {
    @Column(columnDefinition = "int(11) comment '购买数量' ")
    private Integer buyCount;
//    @Column(columnDefinition = "varchar(255) comment '渠道'")
//    private String channel;
    @Column(columnDefinition = "bigint(20) comment '用户ID'")
    private Long customerId;
    @Column(columnDefinition = "bigint(20) comment '产品ID'")
    private Long productId;
    @Column(columnDefinition = "varchar(255) comment '分销码'")
    private String salesCode;
    @Column(columnDefinition = "varchar(255) comment '用户分享码'")
    private String shareCode;
    @Column(columnDefinition = "bigint comment '商家ID'")
    private Long merchantId;
    @Column(columnDefinition = "bigint comment '平台ID'")
    private Long mallId;

    @Column(columnDefinition = "varchar(255) comment '渠道销售码'")
    private String channelSalesCode;

    public Integer getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Integer buyCount) {
        this.buyCount = buyCount;
    }

//    public String getChannel() {
//        return channel;
//    }
//
//    public void setChannel(String channel) {
//        this.channel = channel;
//    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getSalesCode() {
        return salesCode;
    }

    public void setSalesCode(String salesCode) {
        this.salesCode = salesCode;
    }

    public String getShareCode() {
        return shareCode;
    }

    public void setShareCode(String shareCode) {
        this.shareCode = shareCode;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getChannelSalesCode() {
        return channelSalesCode;
    }

    public void setChannelSalesCode(String channelSalesCode) {
        this.channelSalesCode = channelSalesCode;
    }

    @Override
    public String toString() {
        return "ShoppingCart{" +
                "buyCount=" + buyCount +
                ", id=" + id +
                ", customerId=" + customerId +
                ", dateCreated=" + dateCreated +
                ", productId=" + productId +
                ", lastUpdated=" + lastUpdated +
                ", salesCode='" + salesCode + '\'' +
                ", shareCode='" + shareCode + '\'' +
                ", isDelete=" + isDelete +
                ", merchantId=" + merchantId +
                ", version=" + version +
                ", mallId=" + mallId +
                ", channelSalesCode='" + channelSalesCode + '\'' +
                '}';
    }
}
